package com.ssy.lingxi.order.repository;

import com.ssy.lingxi.order.entity.OrderTradeProcessDO;
import com.ssy.lingxi.order.entity.OrderTradeProcessPaymentDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 交易流程规则的支付环节配置Jpa仓库
 * @author 万宁
 * @version 2.0.0
 * @date 2021-07-24
 */
@Repository
public interface OrderTradeProcessPaymentRepository extends JpaRepository<OrderTradeProcessPaymentDO, Long>, JpaSpecificationExecutor<OrderTradeProcessPaymentDO> {
    List<OrderTradeProcessPaymentDO> findByProcess(OrderTradeProcessDO process);

    @Transactional
    void deleteByProcess(OrderTradeProcessDO process);
}
